str = input("请输入一段字符：")
length = len(str)
alpha = 0
digit = 0
space = 0
others = 0
i = 0
for each in str:
    str1 = str[i]
    i += 1
    if str1.isalpha():
        alpha += 1
    elif str1.isdigit():
        digit += 1
    elif str1.isspace():
        space += 1
    else:
        others += 1
print("字母有{}个，数字有{}个，空格有{}个，其他字符有{}个".format(alpha,digit,space,others))